﻿using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Volo.Abp.Guids;

namespace Himp.ShareData
{
    /// <summary>
    /// 科室manager
    /// </summary>
    public class DeptManager : DomainService
    {
        private readonly IGuidGenerator _guidGenerator;

        public DeptManager(IGuidGenerator guidGenerator)
        {
            _guidGenerator = guidGenerator;
        }

        /// <summary>
        /// 创建科室
        /// </summary>
        /// <param name="deptmentClassificationValue"></param>
        /// <param name="deptmentClassificationLabel"></param>
        /// <param name="hospDeptCodg"></param>
        /// <param name="hospDeptName"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        public DeptInfo CreateDept(Guid? parentId, [NotNull] string hospDeptCodg, [NotNull] string hospDeptName
           , [NotNull] string catyCode, [NotNull] string catyName, Guid? organId, int srtNo
           , DateTime? begntime, DateTime? endtime, string itro)
        {
            var deptment = new DeptInfo(parentId, hospDeptCodg, hospDeptName, catyCode, catyName, organId, srtNo
                ,begntime, endtime, itro);

            return deptment;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="deptInfo"></param>
        /// <param name="deptmentPropertyIds"></param>
        public void SetDeptmentProperty(DeptInfo deptInfo, [NotNull] List<Guid> deptAttrIdList)
        {
            deptInfo.SetDeptmentProperty(_guidGenerator, deptAttrIdList);
        }
    }
}
